#include<iostream>
#include<vector>
using namespace std;

vector<vector<int>> ret;
vector<int> path;

void dfs(int pos, int n)
{
    ret.push_back(path);
    for (int i = pos; i <= n; i++)
    {
        path.push_back(i);
        dfs(i + 1, n);
        path.pop_back();
    }
}
int main()
{
    int n = 0;
    cin >> n;
    dfs(1, n);
    for (auto subq : ret)
    {
        for (int num : subq)
            cout << num;
        cout << endl;
    }
    return 0;
}